package com.ruoyi.project.doctors.controller;


import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.doctors.domain.Patient;
import com.ruoyi.project.doctors.serivce.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/his/patient/")
public class PatientController extends BaseController {
    @Autowired
    private PatientService patientService;

    @GetMapping("list")
    public TableDataInfo list(Patient patient){
        startPage();
        List<Patient> list = patientService.selectPatient(patient);
        return getDataTable(list);
    }

    @GetMapping("listPatient")
    public AjaxResult listPatient(Patient patient){
        List<Patient> list = patientService.selectPatient(patient);
        return AjaxResult.success(list);
    }



}
